<template>
    <div class="hello"  id="app">
      <h1>{{ msg }}</h1>

    </div>
    <div v-for="site in info.sites">
      {{ site.name }}
    </div>
  </template>
   
  <script>
  import axios from "axios"
  export default {
    name: 'hello',
    data () {
      return {
        msg: '欢迎来到菜鸟教程！',
        info: {}
      }
    },
    mounted () {
    axios
      .get('/api/v1/hello')  
      .then(response => (this.info = response.data))
      .catch(function (error) { // 请求失败处理
        console.log(error);
      });
  }
    
  };


  </script>

  